package com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.internetofthings.firefightingiot;

import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.common.base.BaseService;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.utils.requestutil.HttpRequestUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * 阀值设置服务
 * @author Yang yu
 * @version 1.0
 * @date 2020/7/17 18:57
 */
@Service
@Slf4j
public class ItemSetupService extends BaseService {



    /**
     * 阀值设置列表
     * @param
     * @return
     */
    public RespEntity getItemSetupList(JSONObject jsonParam) {
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());

        return fireFightingiotJava(jsonParam,"getItem","device");
    }

    /**
     * 阀值设置
     * @param
     * @return
     */
    public RespEntity insertItemSetup(JSONObject jsonParam) {
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return fireFightingiotJava(jsonParam,"insertItemSetup","device");
    }

    /**
     * 语音短信状态列表
     * @param jsonParam
     * @return
     */
    public RespEntity getSendMsgStateList(JSONObject jsonParam) {
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return fireFightingiotJava(jsonParam,"getSendMsgStateList","device");
    }

    /**
     * 设备语音短信状态新增
     * @param jsonParam
     * @return
     */
    public RespEntity insertSendMsgState(JSONObject jsonParam) {
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return fireFightingiotJava(jsonParam,"insertSendMsgState","device");
    }
    /**
     * 通讯记录分页列表
     * @param jsonParam
     * @return
     */
    public RespEntity getCommunicationRecordListPage(JSONObject jsonParam) {
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return fireFightingiotJava(jsonParam,"getCommunicationRecordListPage","device");
    }
    /**
     * 一键开启或关闭语音短信
     * @param jsonParam
     * @return
     */
    public RespEntity oneClickOnOrOff(JSONObject jsonParam) {
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return fireFightingiotJava(jsonParam,"oneClickOnOrOff","device");
    }
}
